home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 2 / BBS in a box - Trilogy II.iso / Files / Mag / P-S / Replace-Existing Hacks 1.3 < prev    next >
Encoding:
Text File  |  1993-08-31  |  3.1 KB  |  80 lines  |  [TEXT/ttxt]

  1.  
  2. -
  3.  
  4.   REPLACE-EXISTING_ HACKS_
  5.  
  6.  
  7.   ~by James W. Walker~ 
  8.   CIS: 76367,2271
  9.   AOL: JWWalker
  10.  
  11.   **Version 1.3, August 1993**
  12.  
  13. If you have ever been annoyed at having to reach for the mouse to respond to the “Replace existing fubar?” dialog, here are some ways to fix it with ResEdit.  Before giving the recipes, I should mention that responsible experts always say that you should only use ResEdit on a ~copy~ of your System file, not the one that is in use.  Don’t say you weren’t warned.
  14.  
  15.  
  16. System 6
  17. --------
  18.  
  19. Open the ALRT -3996 resource in the System.  Select “Set 'ALRT' Stage Info…” from the menu.  In the resulting dialog box, change the radio buttons to indicate that Cancel, rather than OK, is the default button at each stage.
  20.  
  21.  
  22. System 7.0, 7.0.1
  23. -----------------
  24.  
  25. For our first hack, we have a way to make Replace rather than Cancel be the default button.  Edit the PACK 3 resource.  ResEdit will warn you that this resource is compressed and editing it will decompress it, but never mind that.  Normally you will get the hex editor, but if you happen to have the CODE editor installed in your copy of ResEdit, you may have to open the hex editor manually.  Anyway, find offset 202C, and change 670A to 670C.  (If what you see at offset 202C is not 670A, all bets are off.)  Close the System and save changes.
  26.  
  27. Second, there is a hack by Elizabeth Wylie that leaves the buttons alone, but lets you Save with the option key pressed and replace the existing file without even seeing the dialog.  Open the PACK 3 resource with the hex editor.  At offset 9EC, change 6100 16B0 to 6100 2B2A.  At the end of the resource, append:
  28. 1038 017B 0800 0002
  29. 6700 0006 7001 4E75
  30. 6100 EB74 4E75
  31. Close and save changes.
  32.  
  33. Finally, you could use both hacks.
  34.  
  35.  
  36. System 7.1
  37. ----------
  38.  
  39. The idea is the same as for 7.0, but the addresses change.
  40.  
  41. For the default button hack, at the address 2104 change 670A to 670C.
  42.  
  43. For the option key hack, at address A36 change 6100 173E to 6100 2BDE, and append
  44.  
  45. 1038 017B 0800 0002
  46. 6700 0006 7001 4E75
  47. 6100 EB4E 4E75.
  48.  
  49.  
  50. What Was Wrong With Previous Versions
  51. -------------------------------------
  52.  
  53. The way the replace warning normally works is that the cancel button is the default button, so both command-period and return press the cancel button.  Previous versions of my hack essentially switched the buttons.  Then the return key activates the replace button, ~but so does command-period~.  That could have unfortunate consequences.  There’s also the fact that the older versions required changing a DITL resource, while this version changes only PACK 3.
  54.  
  55.  
  56. Technical Information
  57. ---------------------
  58.  
  59. For programmers, here’s the disassembly of the PACK 3 hacks.  The default button hack replaces
  60.  BEQ.S  *+$000C
  61. with
  62.  BEQ.S  *+$000E
  63. This skips an instruction that sets the cancel button as the default.
  64.  
  65. The second hack replaces
  66.   BSR     Anon89 + $10
  67. with
  68.   BSR     Anon149
  69. and appends
  70.  
  71. Anon149
  72.   move.B  $017B, D0    ; Get the byte at KeyMap + 7.
  73.   btst    #$02, D0     ; Is the option key down?
  74.   beq     Anon150      ; If not, do usual stuff
  75.   moveQ   #$01, D0     ; If so, skip the dialog.
  76.   RTS
  77. Anon150
  78.   bsr     Anon89 + $10
  79.   RTS
  80.